package com.cloud.service;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.cloud.core.BaseService;
import com.cloud.dao.CourseBean;
import com.cloud.dao.impl.TempleteDao;

/**
 * 1Cloud1
 * @author Administrator
 * @since 2016-1-16
 * @version 1.0 
 */
@Service("TempleteService")
public class TempleteService extends BaseService{
	
	@Autowired
	private TempleteDao TempleteDao;
	
	/**
	 * 查询表名称
	 * @param tempId
	 * @return
	 */
	public String getTableNameByPro(CourseBean course){
		List<String> list = TempleteDao.getTableNameByPro(course);
		if(list != null && list.size() == 1)
			return list.get(0);
		return "";
	}
	
	/**
	 * 查询表名称
	 * @param tempId
	 * @return
	 */
	public String getTableName(String tempId){
		List<String> list = TempleteDao.getTableName(tempId);
		if(list != null && list.size() == 1)
			return list.get(0);
		return "";
	}
	
	/**
	 * 查询英文字段
	 * @param tempId
	 * @return
	 */
	public List<String> getColumnList(String tempId){
		return TempleteDao.getColumnList(tempId);
	}
	
	/**
	 * 查询病程
	 * @param bean
	 * @return
	 */
	public List<CourseBean> getCourseList(CourseBean bean){
		return TempleteDao.getCourseList(bean);
	}
	
	/**
	 * 添加病程
	 * @param params
	 */
	public void addCourse(Map<String, String> params){
		TempleteDao.addCourse(params);
	}
	
	/**
	 * 删除病程
	 * @param bean
	 */
	public void deleteCourse(CourseBean bean){
		TempleteDao.deleteCourse(bean);
	}
}
